package common

type Queryer interface {
	Where(string, interface{}) Queryer
	Find(v interface{}) Queryer
	First(v interface{}) Queryer
	Error() error
}

type query struct {
	whereMap map[string]interface{}
	err      error
}

func (q *query) Where(whereStr string, v interface{}) Queryer {
	if _, ok := q.whereMap[whereStr]; !ok {

	}
	// select * from table where xxx=? and yyy=? ;
	return q
}

func (q *query) Find(v interface{}) Queryer {
	return q
}

func (q *query) First(v interface{}) Queryer {
	return q
}

func (q query) Error() error {
	return q.err
}

func NewQuery() *query {
	return &query{
		whereMap: make(map[string]interface{}),
	}
}
